package com.smart.common.config.satoken;


import com.alibaba.ttl.TransmittableThreadLocal;

import java.util.Map;


/**
 * 本息线程共享参数
 *
 * @author Administrator
 * @date 2023/09/15
 */
public class LocalContextClient {

    // 使用 jdk提供的子实现，能够在子线程中获取到父线程的值
    private static final TransmittableThreadLocal< Map<String, String>> THREAD_LOCAL_PAT = new TransmittableThreadLocal<>();



    public static void set( Map<String, String> data) {
        THREAD_LOCAL_PAT.set(data);
    }

    public static  Map<String, String> get() {
        return THREAD_LOCAL_PAT.get();
    }


    public static void remove() {
        THREAD_LOCAL_PAT.remove();
    }

}
